#include "appwindow.hpp"

AppWindow::AppWindow()
{
    set_title("Awesome Chess");

    // A utility class for constructing things that go into menus, which
    // we'll set up next.
    using Gtk::Menu_Helpers::MenuElem;

    // Set up the application menu
    // The slot we use here just causes AppWindow::hide() on this,
    // which shuts down the application.
    m_menu_app.items().push_back(MenuElem("_Quit", Gtk::AccelKey("q"),
    sigc::mem_fun(*this, &AppWindow::hide)));

    m_menubar.items().push_back(Gtk::Menu_Helpers::MenuElem("_Application", m_menu_app));

    // Pack in our widgets

    // First add the vertical box as our single "top" widget
    add(m_vbox);

    // Put the menubar on the top, and make it as small as possible
    m_vbox.pack_start(m_menubar, Gtk::PACK_SHRINK);

    // Put the viewer below the menubar. pack_start "grows" the widget
    // by default, so it'll take up the rest of the window.
    m_viewer.set_size_request(300, 300);
    m_vbox.pack_start(m_viewer);

    m_vbox.pack_start(dataLabel, Gtk::PACK_SHRINK);

    show_all();
}
